
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" lang="zh_Hans">
  <head>
    <meta http-equiv="X-UA-Compatible" content="IE=Edge" />
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>模型索引参考 &#8212; Django 3.2.6.dev 文档</title>
    <link rel="stylesheet" href="../../_static/default.css" type="text/css" />
    <link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
    <script type="text/javascript" id="documentation_options" data-url_root="../../" src="../../_static/documentation_options.js"></script>
    <script type="text/javascript" src="../../_static/jquery.js"></script>
    <script type="text/javascript" src="../../_static/underscore.js"></script>
    <script type="text/javascript" src="../../_static/doctools.js"></script>
    <script type="text/javascript" src="../../_static/language_data.js"></script>
    <link rel="index" title="索引" href="../../genindex.html" />
    <link rel="search" title="搜索" href="../../search.html" />
    <link rel="next" title="约束参考" href="constraints.html" />
    <link rel="prev" title="模型字段参考" href="fields.html" />



 
<script src="../../templatebuiltins.js"></script>
<script>
(function($) {
    if (!django_template_builtins) {
       // templatebuiltins.js missing, do nothing.
       return;
    }
    $(document).ready(function() {
        // Hyperlink Django template tags and filters
        var base = "../templates/builtins.html";
        if (base == "#") {
            // Special case for builtins.html itself
            base = "";
        }
        // Tags are keywords, class '.k'
        $("div.highlight\\-html\\+django span.k").each(function(i, elem) {
             var tagname = $(elem).text();
             if ($.inArray(tagname, django_template_builtins.ttags) != -1) {
                 var fragment = tagname.replace(/_/, '-');
                 $(elem).html("<a href='" + base + "#" + fragment + "'>" + tagname + "</a>");
             }
        });
        // Filters are functions, class '.nf'
        $("div.highlight\\-html\\+django span.nf").each(function(i, elem) {
             var filtername = $(elem).text();
             if ($.inArray(filtername, django_template_builtins.tfilters) != -1) {
                 var fragment = filtername.replace(/_/, '-');
                 $(elem).html("<a href='" + base + "#" + fragment + "'>" + filtername + "</a>");
             }
        });
    });
})(jQuery);</script>

  </head><body>

    <div class="document">
  <div id="custom-doc" class="yui-t6">
    <div id="hd">
      <h1><a href="../../index.html">Django 3.2.6.dev 文档</a></h1>
      <div id="global-nav">
        <a title="Home page" href="../../index.html">Home</a>  |
        <a title="Table of contents" href="../../contents.html">Table of contents</a>  |
        <a title="Global index" href="../../genindex.html">Index</a>  |
        <a title="Module index" href="../../py-modindex.html">Modules</a>
      </div>
      <div class="nav">
    &laquo; <a href="fields.html" title="模型字段参考">previous</a>
     |
    <a href="../index.html" title="API 参考" accesskey="U">up</a>
   |
    <a href="constraints.html" title="约束参考">next</a> &raquo;</div>
    </div>

    <div id="bd">
      <div id="yui-main">
        <div class="yui-b">
          <div class="yui-g" id="ref-models-indexes">
            
  <div class="section" id="s-module-django.db.models.indexes">
<span id="s-model-index-reference"></span><span id="module-django.db.models.indexes"></span><span id="model-index-reference"></span><h1>模型索引参考<a class="headerlink" href="#module-django.db.models.indexes" title="永久链接至标题">¶</a></h1>
<p>索引类便于创建数据库索引。它们可以使用 <a class="reference internal" href="options.html#django.db.models.Options.indexes" title="django.db.models.Options.indexes"><code class="xref py py-attr docutils literal notranslate"><span class="pre">Meta.indexes</span></code></a> 选项来添加。本文档解释了 <a class="reference internal" href="#django.db.models.Index" title="django.db.models.Index"><code class="xref py py-class docutils literal notranslate"><span class="pre">Index</span></code></a> 的 API 引用，其中包括 <a class="reference internal" href="#index-options">index options</a> 。</p>
<div class="admonition-referencing-built-in-indexes admonition">
<p class="first admonition-title">引用内置索引</p>
<p class="last">索引是在 <code class="docutils literal notranslate"><span class="pre">django.db.models.indexes</span></code> 中定义的，但为了方便，它们被导入到 <a class="reference internal" href="../../topics/db/models.html#module-django.db.models" title="django.db.models"><code class="xref py py-mod docutils literal notranslate"><span class="pre">django.db.models</span></code></a> 中。标准的惯例是使用 <code class="docutils literal notranslate"><span class="pre">from</span> <span class="pre">django.db</span> <span class="pre">import</span> <span class="pre">models</span></code> 并将索引称为 <code class="docutils literal notranslate"><span class="pre">models.</span> <span class="pre">&lt;IndexClass&gt;</span></code>。</p>
</div>
<div class="section" id="s-index-options">
<span id="index-options"></span><h2><code class="docutils literal notranslate"><span class="pre">Index</span></code> 选项<a class="headerlink" href="#index-options" title="永久链接至标题">¶</a></h2>
<dl class="class">
<dt id="django.db.models.Index">
<em class="property">class </em><code class="descname">Index</code>(<em>*expressions</em>, <em>fields=()</em>, <em>name=None</em>, <em>db_tablespace=None</em>, <em>opclasses=()</em>, <em>condition=None</em>, <em>include=None</em>)<a class="headerlink" href="#django.db.models.Index" title="永久链接至目标">¶</a></dt>
<dd><p>在数据库中创建一个索引（B 树）。</p>
</dd></dl>

<div class="section" id="s-expressions">
<span id="expressions"></span><h3><code class="docutils literal notranslate"><span class="pre">expressions</span></code><a class="headerlink" href="#expressions" title="永久链接至标题">¶</a></h3>
<dl class="attribute">
<dt id="django.db.models.Index.expressions">
<code class="descclassname">Index.</code><code class="descname">expressions</code><a class="headerlink" href="#django.db.models.Index.expressions" title="永久链接至目标">¶</a></dt>
<dd></dd></dl>

<div class="versionadded">
<span class="title">New in Django 3.2.</span> </div>
<p>Positional argument <code class="docutils literal notranslate"><span class="pre">*expressions</span></code> allows creating functional indexes on
expressions and database functions.</p>
<p>例子：</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">Index</span><span class="p">(</span><span class="n">Lower</span><span class="p">(</span><span class="s1">&#39;title&#39;</span><span class="p">)</span><span class="o">.</span><span class="n">desc</span><span class="p">(),</span> <span class="s1">&#39;pub_date&#39;</span><span class="p">,</span> <span class="n">name</span><span class="o">=</span><span class="s1">&#39;lower_title_date_idx&#39;</span><span class="p">)</span>
</pre></div>
</div>
<p>creates an index on the lowercased value of the <code class="docutils literal notranslate"><span class="pre">title</span></code> field in descending
order and the <code class="docutils literal notranslate"><span class="pre">pub_date</span></code> field in the default ascending order.</p>
<p>Another example:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">Index</span><span class="p">(</span><span class="n">F</span><span class="p">(</span><span class="s1">&#39;height&#39;</span><span class="p">)</span> <span class="o">*</span> <span class="n">F</span><span class="p">(</span><span class="s1">&#39;weight&#39;</span><span class="p">),</span> <span class="n">Round</span><span class="p">(</span><span class="s1">&#39;weight&#39;</span><span class="p">),</span> <span class="n">name</span><span class="o">=</span><span class="s1">&#39;calc_idx&#39;</span><span class="p">)</span>
</pre></div>
</div>
<p>creates an index on the result of multiplying fields <code class="docutils literal notranslate"><span class="pre">height</span></code> and <code class="docutils literal notranslate"><span class="pre">weight</span></code>
and the <code class="docutils literal notranslate"><span class="pre">weight</span></code> rounded to the nearest integer.</p>
<p><a class="reference internal" href="#django.db.models.Index.name" title="django.db.models.Index.name"><code class="xref py py-attr docutils literal notranslate"><span class="pre">Index.name</span></code></a> is required when using <code class="docutils literal notranslate"><span class="pre">*expressions</span></code>.</p>
<div class="admonition-restrictions-on-oracle admonition">
<p class="first admonition-title">Restrictions on Oracle</p>
<p class="last">Oracle requires functions referenced in an index to be marked as
<code class="docutils literal notranslate"><span class="pre">DETERMINISTIC</span></code>. Django doesn't validate this but Oracle will error. This
means that functions such as
<a class="reference internal" href="database-functions.html#django.db.models.functions.Random" title="django.db.models.functions.Random"><code class="xref py py-class docutils literal notranslate"><span class="pre">Random()</span></code></a> aren't accepted.</p>
</div>
<div class="admonition-restrictions-on-postgresql admonition">
<p class="first admonition-title">PostgreSQL 的限制</p>
<p class="last">PostgreSQL requires functions and operators referenced in an index to be
marked as <code class="docutils literal notranslate"><span class="pre">IMMUTABLE</span></code>. Django doesn't validate this but PostgreSQL will
error. This means that functions such as
<a class="reference internal" href="database-functions.html#django.db.models.functions.Concat" title="django.db.models.functions.Concat"><code class="xref py py-class docutils literal notranslate"><span class="pre">Concat()</span></code></a> aren't accepted.</p>
</div>
<div class="admonition-mysql-and-mariadb admonition">
<p class="first admonition-title">MySQL 和 MariaDB</p>
<p class="last">Functional indexes are ignored with MySQL &lt; 8.0.13 and MariaDB as neither
supports them.</p>
</div>
</div>
<div class="section" id="s-fields">
<span id="fields"></span><h3><code class="docutils literal notranslate"><span class="pre">fields</span></code><a class="headerlink" href="#fields" title="永久链接至标题">¶</a></h3>
<dl class="attribute">
<dt id="django.db.models.Index.fields">
<code class="descclassname">Index.</code><code class="descname">fields</code><a class="headerlink" href="#django.db.models.Index.fields" title="永久链接至目标">¶</a></dt>
<dd></dd></dl>

<p>需要索引字段的名称列表或元组。</p>
<p>默认情况下，索引是以每列的升序创建的。要为列定义一个降序索引，请在字段名前添加一个连字符。</p>
<p>例如 <code class="docutils literal notranslate"><span class="pre">Index(fields=['headline',</span> <span class="pre">'-pub_date'])</span></code> 将创建 SQL 为 <code class="docutils literal notranslate"><span class="pre">(headline,</span> <span class="pre">pub_date</span> <span class="pre">DESC)</span></code>。MySQL 上不支持索引排序。在这种情况下，降序索引会像普通索引一样被创建。</p>
</div>
<div class="section" id="s-name">
<span id="name"></span><h3><code class="docutils literal notranslate"><span class="pre">name</span></code><a class="headerlink" href="#name" title="永久链接至标题">¶</a></h3>
<dl class="attribute">
<dt id="django.db.models.Index.name">
<code class="descclassname">Index.</code><code class="descname">name</code><a class="headerlink" href="#django.db.models.Index.name" title="永久链接至目标">¶</a></dt>
<dd></dd></dl>

<p>索引的名称。如果没有提供 <code class="docutils literal notranslate"><span class="pre">name</span></code>，Django 会自动生成一个名称。为了兼容不同的数据库，索引名不能超过 30 个字符，并且不应该以数字（0-9）或下划线（_）开头。</p>
<div class="admonition-partial-indexes-in-abstract-base-classes admonition">
<p class="first admonition-title">抽象基类中的部分索引</p>
<p class="last">你必须始终为索引指定一个唯一的名称。因此，通常不能在抽象基类上指定部分索引，因为 <a class="reference internal" href="options.html#django.db.models.Options.indexes" title="django.db.models.Options.indexes"><code class="xref py py-attr docutils literal notranslate"><span class="pre">Meta.indexes</span></code></a> 选项是由子类继承的，每次的属性值（包括 <code class="docutils literal notranslate"><span class="pre">name</span></code> ）都完全相同。为了解决名称碰撞的问题，名称的一部分可以包含 <code class="docutils literal notranslate"><span class="pre">'%(app_label)s'</span></code> 和 <code class="docutils literal notranslate"><span class="pre">'%(class)s'</span></code>，它们分别被具体模型的小写应用标签和类名所代替。例如 <code class="docutils literal notranslate"><span class="pre">Index(field=['title'],</span> <span class="pre">name='%(app_label)s_%(class)s_title_index')</span></code>。</p>
</div>
</div>
<div class="section" id="s-db-tablespace">
<span id="db-tablespace"></span><h3><code class="docutils literal notranslate"><span class="pre">db_tablespace</span></code><a class="headerlink" href="#db-tablespace" title="永久链接至标题">¶</a></h3>
<dl class="attribute">
<dt id="django.db.models.Index.db_tablespace">
<code class="descclassname">Index.</code><code class="descname">db_tablespace</code><a class="headerlink" href="#django.db.models.Index.db_tablespace" title="永久链接至目标">¶</a></dt>
<dd></dd></dl>

<p>该索引要使用的 <a class="reference internal" href="../../topics/db/tablespaces.html"><span class="doc">数据库表空间</span></a> 名称。对于单字段索引，如果没有提供 <code class="docutils literal notranslate"><span class="pre">db_tablespace</span></code>，则在字段的 <code class="docutils literal notranslate"><span class="pre">db_tablespace</span></code> 中创建索引。</p>
<p>如果没有指定 <a class="reference internal" href="fields.html#django.db.models.Field.db_tablespace" title="django.db.models.Field.db_tablespace"><code class="xref py py-attr docutils literal notranslate"><span class="pre">Field.db_tablespace</span></code></a> （或者如果索引使用了多个字段），则在模型的 <code class="docutils literal notranslate"><span class="pre">class</span> <span class="pre">Meta</span></code> 里面的 <a class="reference internal" href="options.html#django.db.models.Options.db_tablespace" title="django.db.models.Options.db_tablespace"><code class="xref py py-attr docutils literal notranslate"><span class="pre">db_tablespace</span></code></a> 选项中指定的表空间创建索引。如果这两个表空间都没有设置，则在与表相同的表空间中创建索引。</p>
<div class="admonition seealso">
<p class="first admonition-title">参见</p>
<p class="last">关于 PostgreSQL 特有的索引列表，请参见 <a class="reference internal" href="../contrib/postgres/indexes.html#module-django.contrib.postgres.indexes" title="django.contrib.postgres.indexes"><code class="xref py py-mod docutils literal notranslate"><span class="pre">django.contrib.postgres.indexes</span></code></a>。</p>
</div>
</div>
<div class="section" id="s-opclasses">
<span id="opclasses"></span><h3><code class="docutils literal notranslate"><span class="pre">opclasses</span></code><a class="headerlink" href="#opclasses" title="永久链接至标题">¶</a></h3>
<dl class="attribute">
<dt id="django.db.models.Index.opclasses">
<code class="descclassname">Index.</code><code class="descname">opclasses</code><a class="headerlink" href="#django.db.models.Index.opclasses" title="永久链接至目标">¶</a></dt>
<dd></dd></dl>

<p>要为这个索引使用的 <a class="reference external" href="https://www.postgresql.org/docs/current/indexes-opclass.html">PostgreSQL 运算符类</a> 名称。如果你需要一个自定义的操作类，你必须为索引中的每个字段提供一个操作类。</p>
<p>例如，<code class="docutils literal notranslate"><span class="pre">GinIndex(name='json_index',</span> <span class="pre">fields=['jsonfield'],</span> <span class="pre">opclasses=['jsonb_path_ops'])</span></code> 使用 <code class="docutils literal notranslate"><span class="pre">jsonb_path_ops</span></code> 在 <code class="docutils literal notranslate"><span class="pre">jsonfield</span></code> 上创建一个 gin 索引。</p>
<p><code class="docutils literal notranslate"><span class="pre">opclasses</span></code> 对于 PostgreSQL 以外的数据库来说是被忽略的。</p>
<p><a class="reference internal" href="#django.db.models.Index.name" title="django.db.models.Index.name"><code class="xref py py-attr docutils literal notranslate"><span class="pre">Index.name</span></code></a> 在使用 <code class="docutils literal notranslate"><span class="pre">opclasses</span></code> 时需要。</p>
</div>
<div class="section" id="s-condition">
<span id="condition"></span><h3><code class="docutils literal notranslate"><span class="pre">condition</span></code><a class="headerlink" href="#condition" title="永久链接至标题">¶</a></h3>
<dl class="attribute">
<dt id="django.db.models.Index.condition">
<code class="descclassname">Index.</code><code class="descname">condition</code><a class="headerlink" href="#django.db.models.Index.condition" title="永久链接至目标">¶</a></dt>
<dd></dd></dl>

<p>如果表非常大，而且你的查询主要针对行的子集，那么将索引限制在该子集上可能会很有用。将条件指定为 <a class="reference internal" href="querysets.html#django.db.models.Q" title="django.db.models.Q"><code class="xref py py-class docutils literal notranslate"><span class="pre">Q</span></code></a>。例如，<code class="docutils literal notranslate"><span class="pre">condition=Q(pages__gt=400)</span></code> 对超过 400 页的记录进行索引。</p>
<p><a class="reference internal" href="#django.db.models.Index.name" title="django.db.models.Index.name"><code class="xref py py-attr docutils literal notranslate"><span class="pre">Index.name</span></code></a> 在使用 <code class="docutils literal notranslate"><span class="pre">condition</span></code> 时需要。</p>
<div class="admonition-restrictions-on-postgresql admonition">
<p class="first admonition-title">PostgreSQL 的限制</p>
<p class="last">PostgreSQL 要求条件中引用的函数必须标记为 IMMUTABLE。Django 不会验证这一点，但 PostgreSQL 会报错。这意味着诸如 <a class="reference internal" href="database-functions.html#date-functions"><span class="std std-ref">日期函数</span></a> 和 <code class="xref py py-class docutils literal notranslate"><span class="pre">Concat</span></code> 这样的函数不被接受。如果你把日期存储在 <a class="reference internal" href="fields.html#django.db.models.DateTimeField" title="django.db.models.DateTimeField"><code class="xref py py-class docutils literal notranslate"><span class="pre">DateTimeField</span></code></a> 中，与 <a class="reference external" href="https://docs.python.org/3/library/datetime.html#datetime.datetime" title="(在 Python v3.9)"><code class="xref py py-class docutils literal notranslate"><span class="pre">datetime</span></code></a> 对象进行比较时，可能需要提供 <code class="docutils literal notranslate"><span class="pre">tzinfo</span></code> 参数，否则比较的结果可能是一个可变的函数，因为 Django 对 <span class="xref std std-ref">lookups</span> 进行了转换。</p>
</div>
<div class="admonition-restrictions-on-sqlite admonition">
<p class="first admonition-title">SQLite 的限制</p>
<p class="last">SQLite 对如何构建部分索引 <a class="reference external" href="https://www.sqlite.org/partialindex.html">施加了限制</a> 。</p>
</div>
<div class="admonition-oracle admonition">
<p class="first admonition-title">Oracle</p>
<p class="last">Oracle does not support partial indexes. Instead, partial indexes can be
emulated by using functional indexes together with
<a class="reference internal" href="conditional-expressions.html#django.db.models.expressions.Case" title="django.db.models.expressions.Case"><code class="xref py py-class docutils literal notranslate"><span class="pre">Case</span></code></a> expressions.</p>
</div>
<div class="admonition-mysql-and-mariadb admonition">
<p class="first admonition-title">MySQL 和 MariaDB</p>
<p class="last">在 MySQL 和 MariaDB 中，<code class="docutils literal notranslate"><span class="pre">condition</span></code> 参数被忽略，因为它们都不支持条件索引。</p>
</div>
</div>
<div class="section" id="s-include">
<span id="include"></span><h3><code class="docutils literal notranslate"><span class="pre">include</span></code><a class="headerlink" href="#include" title="永久链接至标题">¶</a></h3>
<dl class="attribute">
<dt id="django.db.models.Index.include">
<code class="descclassname">Index.</code><code class="descname">include</code><a class="headerlink" href="#django.db.models.Index.include" title="永久链接至目标">¶</a></dt>
<dd></dd></dl>

<div class="versionadded">
<span class="title">New in Django 3.2.</span> </div>
<p>A list or tuple of the names of the fields to be included in the covering index
as non-key columns. This allows index-only scans to be used for queries that
select only included fields (<a class="reference internal" href="#django.db.models.Index.include" title="django.db.models.Index.include"><code class="xref py py-attr docutils literal notranslate"><span class="pre">include</span></code></a>) and filter only by indexed
fields (<a class="reference internal" href="#django.db.models.Index.fields" title="django.db.models.Index.fields"><code class="xref py py-attr docutils literal notranslate"><span class="pre">fields</span></code></a>).</p>
<p>例子：</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">Index</span><span class="p">(</span><span class="n">name</span><span class="o">=</span><span class="s1">&#39;covering_index&#39;</span><span class="p">,</span> <span class="n">fields</span><span class="o">=</span><span class="p">[</span><span class="s1">&#39;headline&#39;</span><span class="p">],</span> <span class="n">include</span><span class="o">=</span><span class="p">[</span><span class="s1">&#39;pub_date&#39;</span><span class="p">])</span>
</pre></div>
</div>
<p>will allow filtering on <code class="docutils literal notranslate"><span class="pre">headline</span></code>, also selecting <code class="docutils literal notranslate"><span class="pre">pub_date</span></code>, while
fetching data only from the index.</p>
<p>Using <code class="docutils literal notranslate"><span class="pre">include</span></code> will produce a smaller index than using a multiple column
index but with the drawback that non-key columns can not be used for sorting or
filtering.</p>
<p><code class="docutils literal notranslate"><span class="pre">include</span></code> is ignored for databases besides PostgreSQL.</p>
<p><a class="reference internal" href="#django.db.models.Index.name" title="django.db.models.Index.name"><code class="xref py py-attr docutils literal notranslate"><span class="pre">Index.name</span></code></a> is required when using <code class="docutils literal notranslate"><span class="pre">include</span></code>.</p>
<p>See the PostgreSQL documentation for more details about <a class="reference external" href="https://www.postgresql.org/docs/current/indexes-index-only-scans.html">covering indexes</a>.</p>
<div class="admonition-restrictions-on-postgresql admonition">
<p class="first admonition-title">PostgreSQL 的限制</p>
<p class="last">PostgreSQL 11+ only supports covering B-Tree indexes, and PostgreSQL 12+
also supports covering <a class="reference internal" href="../contrib/postgres/indexes.html#django.contrib.postgres.indexes.GistIndex" title="django.contrib.postgres.indexes.GistIndex"><code class="xref py py-class docutils literal notranslate"><span class="pre">GiST</span> <span class="pre">indexes</span></code></a>.</p>
</div>
</div>
</div>
</div>


          </div>
        </div>
      </div>
      
        
          <div class="yui-b" id="sidebar">
            
      <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
        <div class="sphinxsidebarwrapper">
  <h3><a href="../../contents.html">Table of Contents</a></h3>
  <ul>
<li><a class="reference internal" href="#">模型索引参考</a><ul>
<li><a class="reference internal" href="#index-options"><code class="docutils literal notranslate"><span class="pre">Index</span></code> 选项</a><ul>
<li><a class="reference internal" href="#expressions"><code class="docutils literal notranslate"><span class="pre">expressions</span></code></a></li>
<li><a class="reference internal" href="#fields"><code class="docutils literal notranslate"><span class="pre">fields</span></code></a></li>
<li><a class="reference internal" href="#name"><code class="docutils literal notranslate"><span class="pre">name</span></code></a></li>
<li><a class="reference internal" href="#db-tablespace"><code class="docutils literal notranslate"><span class="pre">db_tablespace</span></code></a></li>
<li><a class="reference internal" href="#opclasses"><code class="docutils literal notranslate"><span class="pre">opclasses</span></code></a></li>
<li><a class="reference internal" href="#condition"><code class="docutils literal notranslate"><span class="pre">condition</span></code></a></li>
<li><a class="reference internal" href="#include"><code class="docutils literal notranslate"><span class="pre">include</span></code></a></li>
</ul>
</li>
</ul>
</li>
</ul>

  <h4>上一个主题</h4>
  <p class="topless"><a href="fields.html"
                        title="上一章">模型字段参考</a></p>
  <h4>下一个主题</h4>
  <p class="topless"><a href="constraints.html"
                        title="下一章">约束参考</a></p>
  <div role="note" aria-label="source link">
    <h3>本页</h3>
    <ul class="this-page-menu">
      <li><a href="../../_sources/ref/models/indexes.txt"
            rel="nofollow">显示源代码</a></li>
    </ul>
   </div>
<div id="searchbox" style="display: none" role="search">
  <h3>快速搜索</h3>
    <div class="searchformwrapper">
    <form class="search" action="../../search.html" method="get">
      <input type="text" name="q" />
      <input type="submit" value="转向" />
      <input type="hidden" name="check_keywords" value="yes" />
      <input type="hidden" name="area" value="default" />
    </form>
    </div>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
        </div>
      </div>
              <h3>Last update:</h3>
              <p class="topless">7月 23, 2021</p>
          </div>
        
      
    </div>

    <div id="ft">
      <div class="nav">
    &laquo; <a href="fields.html" title="模型字段参考">previous</a>
     |
    <a href="../index.html" title="API 参考" accesskey="U">up</a>
   |
    <a href="constraints.html" title="约束参考">next</a> &raquo;</div>
    </div>
  </div>

      <div class="clearer"></div>
    </div>
  </body>
</html>